public class text_2 {
    public static void main(String[] args) {
        int i = 3;
        System.out.println(i);//4字节
        System.out.println(Integer.MAX_VALUE);//-2^31  —— 2^31 -1
        System.out.println(Integer.MIN_VALUE);
        System.out.println("======1=====");
        long l = 10L;//最好加上L ，规范
        System.out.println(l);//8字节
        System.out.println(Long.MAX_VALUE);//-2^63  —— 2^63 -1
        System.out.println(Long.MIN_VALUE);
        System.out.println("======2=======");
        short s = 29;
        System.out.println(s);//2字节
        System.out.println(Short.MAX_VALUE);//-2^15  —— 2^15 -1
        System.out.println(Short.MIN_VALUE);
        System.out.println("======3=========");
        byte b = 12;
        System.out.println(b);//1字节
        System.out.println(Byte.MAX_VALUE);//-2^7  —— 2^7 -1
        System.out.println(Byte.MIN_VALUE);
        System.out.println("=======4========");
        System.out.println("===============");

        float f = 12.2f;//float 在使用时必须加f否则会认为他是double类型
        float f1 = 12.2F;
        System.out.println(f);//4字节
        System.out.println(f1);
        System.out.println(Float.MAX_VALUE);//-2^31  —— 2^31 -1
        System.out.println(Float.MIN_VALUE);
        System.out.println("=======5=========");

        double d  = 56.556;
        System.out.println(d);//8个字节
        System.out.println(Double.MAX_VALUE);//-2^63  —— 2^63 -1
        System.out.println(Double.MIN_VALUE);
        System.out.println("=========6========");
        System.out.println("=========字符型=====");

        char c = '韩';//2字节
        System.out.println(c);//0  —— 2^16
        System.out.println(Character.MAX_RADIX);
        System.out.println(Character.MIN_VALUE);
        System.out.println("=========7=========");
        System.out.println("=======布尔型=======");

        boolean bool = true;
        boolean bool1 = false;//没有明确规定
        System.out.println(bool);
        System.out.println("==========8========");

        System.out.println("======类型转换=====");
        int a1 = 21;
        long b1 = 23L;
        int c1 = (int)(a1+b1);
        System.out.println(c1);

        byte b2 = 12;
        byte  b3 = 23;
        byte b4 = (byte)( b2+b3);//在计算中，对于小于4字节的运算，会将其转为int类型运算；
        int b4_= b2+b3;

        System.out.println("int ----String");
        int i2 = 1;
       // String string = String.valueOf(i2);//方法一
        String string = 1+"";//方法二
        System.out.println(string);
        System.out.println("=========细节======");
        String str = 1+2+"hello";
        String str1 = "hello"+1+2;
        System.out.println(str);
        System.out.println(str1);//数字加字符串等于连接
        System.out.println("========String-----int=============");
        String str3 = "100";
        //使用Integer类方法
        int ret  = Integer.valueOf(str3);//里面只能是数字，字符会报错
        System.out.println(ret);
        int ret2  = Integer.parseInt(str3);
        System.out.println(ret2+1);
        System.out.println("===============运算细节================");
        int i5 = 12;
        long l5  = 122L;
       // i5 =l5+i5;//出现错误Long类型不能自动转换成int类型
        i5 +=l5;//这种写法会自带一个强制转换类似于i5 =(int)(i5+l5)
        System.out.println(i5);
        System.out.println("===================================");
        int i8 = 5;
        //System.out.println(2<i8<10);//报错，不是同类型









    }
}
